package com.atguigu.principle.dependInversion.dependDeliver3Way.constructionMethodDeliver;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description:
 * @create: 2022-01-10 15:51
 **/
public class OpenAndClose implements IOpenAndClose{
    /**
     * 成员
     */
    private final ITv tv;

    /**
     * 构造器
     * @param tv 成员：接口
     */
    public OpenAndClose(ITv tv) {
        this.tv = tv;
    }
    @Override
    public void open() {
        tv.play();
    }
}
